package com.lvy.hczn.front.web.controller.mq;

import cn.hutool.core.util.IdUtil;
import com.lvy.hczn.mq.rocket.ProducerUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.nio.charset.StandardCharsets;

@RestController
@RequestMapping("/wms/api/mq/rkt/")
public class RocketMqController {

    @Autowired
    private ProducerUtil producerUtil;

    @PostMapping(value = "test")
    public void test() throws Exception{
        producerUtil.sendMsg("TopicSyncWms", "StockInTag", "测试".getBytes(StandardCharsets.UTF_8), IdUtil.fastUUID());
    }
}
